﻿<%@ Page Language="C#" MasterPageFile="~/Auth/AuthFramework.Master" AutoEventWireup="true"
CodeBehind="SetAccessibility.aspx.cs" Inherits="ChapterX.Auth.Teacher.SetAccessibility" %>

<%@ Import Namespace="ChapterX.Common" %>

<%@ Register Src="~/Modules/BookBasicInfo.ascx" TagName="BookBasicInfo" TagPrefix="Module" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="server">

<form id="Form_SetAccessibility" runat="server">
    <asp:HiddenField ID="hf_BookId" runat="server" />
    <asp:HiddenField ID="hf_Account" runat="server" />
    <Module:BookBasicInfo ID="Module_BookBasicInfo" runat="server" />
    <asp:DropDownList ID="ddl_CourseList" runat="server"></asp:DropDownList>

    <div class="data-list-wrapper">
        <asp:Repeater ID="rp_ChapterList" runat="server" 
            onitemdatabound="rp_ChapterList_ItemDataBound">
            <HeaderTemplate>
                <table class="data-list">
                    <thead>
                         <tr>
                            <td>序号</td>
                            <td>是否可访问</td>
                            <td>标题</td>
                            <td>简介</td>
                            <td>上传时间</td>                       
                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td><%# Eval("Seq") %><asp:HiddenField ID="hf_ChpapterId" runat="server" Value='<%# Eval("ChapterId") %>' /></td>
                    <td>
                        <asp:CheckBox ID="cb_Accessibility" runat="server" Checked="true" AutoPostBack="false"/>
                    </td>
                    <td>
                         <asp:HyperLink ID="hl_File" runat="server" Text='<%# Eval("Title") %>' 
                         NavigateUrl='<%# "~/files/book-chapters/" + Eval("BookId") + "/" + Eval("FilePath") %>' >
                         </asp:HyperLink>
                    </td>
                    <td><%# Eval("Descs") %></td>
                    <td><%# Eval("SubmitTime") %></td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                    </tbody>
                </table>
            </FooterTemplate>
        </asp:Repeater>

        <asp:CheckBox ID="cb_SelectAll" runat="server" Text="全选" 
            oncheckedchanged="cb_SelectAll_CheckedChanged" AutoPostBack="True" />
        <br />
        
        <div class="left form-wrapper ui-widget ui-widget-content ui-corner-all">
            <div class="form-header ui-widget-header ui-corner-all">
                <span>设置以上章节的访问用户名和密码：</span>
            </div>
            <div class="form-content">
                <fieldset>
                    <label>用户名</label>
                    <asp:TextBox ID="tb_UserName" runat="server" CssClass="ext ui-widget-content ui-corner-all"></asp:TextBox>
                    <br />
                    <label>密码</label>
                    <asp:TextBox ID="tb_Pwd" runat="server" CssClass="text ui-widget-content ui-corner-all" TextMode="Password"></asp:TextBox>
                </fieldset>
                <asp:Button ID="btn_Submit" runat="server" CssClass="form-button" Text="提交" OnClick="Submit_Click" />
                <asp:Button ID="btn_Return" runat="server" CssClass="form-button" Text="返回" 
                    onclick="btn_Return_Click" />
            </div>
        </div>
        
        
    </div>
</form>
</asp:Content>
